#include <iconv.h>

class class_zm
{
public:
~class_zm()
{
iconv_close(cd);
}

void init(std::string to,std::string from)
{
cd=iconv_open(to.c_str(),from.c_str());
}
std::string zm(std::string str)
{
	if(str.length() < 1){return str;}

char *str_f=(char*)str.c_str();
size_t f_i=strlen(str_f)+1;
size_t t_i=f_i*2;
char str_t[t_i];
char *tttt=str_t;
ret=iconv(cd,&str_f,&f_i,&tttt,&t_i);
std::string str2=str_t;
return str2;
};
iconv_t cd;
int ret;
};
